1. Field of the Invention
The present invention relates to image processing technology, and in particular relates to a method and an apparatus for enhancing image.
2. Description of the Related Art
In digital photography, many approaches have been developed to construct high dynamic range images. One of these approaches is to combine multiple exposures of the same scene to retain detail in light and dark areas.
Various image enhancement approaches are used to improve image quality. Take contrast enhancement as an example, which is a procedure used to improve contrast in images. Compared with global contrast enhancement, local contrast enhancement can bring out more detail in an image. For local contrast enhancement, an image is first divided into several blocks, and then a procedure called histogram equalization is performed to each of the blocks so that the pixel values of pixels in a block are transformed based on a contrast enhancement function of the block.
Histogram equalization processing of the local contrast enhancement may change the brightness of each block. For example, if a block contains more dark pixels, the brightness of the block may increase after the histogram equalization processing. On the other hand, if a block contains more light pixels, the brightness of the block may decrease after the histogram equalization processing. In a scene that its dynamic range is close to the dynamic range an image sensor can reproduce, however, the local contrast enhancement by local histogram equalization may reduce the global contrast due to the block-wise brightness adjustment. That is, if a block contains more dark pixels, the brightness of the block may increase to reveal more details after the histogram equalization processing, but the increased brightness of an original darker block would decrease the global contrast.